﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for FormatString
/// </summary>
public class FormatString
{
    public static string DateTimeToString(string dt)
    {
        DateTime datetime = Convert.ToDateTime(dt);
        return datetime.ToString("dd/MM/yyyy hh:mm");
    }
    public static string SplitString(object str, int length)
    {
        string result = str.ToString();
        if (result.ToString().Length > length)
        {
            while (result[length] != ' ')
            {
                length = length - 1;
            }
            result = result.Substring(0, length) + "[...]";
        }
        return result;
    }

}